package com.lfx.concurrent.interrupted;

/**
 * @author 李逢喜
 * create 2021/7/22
 */
public class InterruptedThread3 extends Thread{


    @Override
    public void run() {
        int i=0;
        while (true){
            boolean interrupted = isInterrupted();
            System.out.println("中断标记：" + interrupted);
            ++i;
            System.out.println("i：" + i);

            if(i>200){

                boolean interrupted1 = Thread.interrupted();
                System.out.println("重置中断状态：" + interrupted1);
                interrupted1 = Thread.interrupted();
                System.out.println("重置中断状态：" + interrupted1);
                interrupted = isInterrupted();
                System.out.println("中断标记：" + interrupted);
                break;
            }
        }
    }
}
